<?php

namespace app\admin\validate;

use think\Validate;

class Category extends Validate
{
    // 验证规则
    protected $rule = [
        'cate_name' => ['require','min' => 2, 'max' => 4,'chs','unique' => ['category','cate_name']],
    ];

    // 提示信息
    protected $message = [
        'cate_name.require' => '分类名不能为空',
        'cate_name.min' => '不能小于2位',
        'cate_name.max' => '过长,不能超过4位',
        'cate_name.chs' => '请填写汉字',
        'cate_name.unique' => '该分类已存在,请重新输入'
    ];

}
